<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        class Calc{
          constructor()
          {
              this.value = 0;
          }

          add(val)
          {
              this.value+=val;
              return this;
          }

          sub(val)
          {
            this.value-=val;
            return this;
          }

          del(val)
          {
             if(val === 0)
             {
                 throw Error("zero del err");
             }
             this.value/=val;
             return this;
          }


          mul(val)
          {
             this.value*=val;
             return this;
          }

          get()
          {
            return this.value;
          }
        }

        let calc = new Calc();
        console.log(calc.add(1).mul(2).sub(3).add(10).mul(10).get());
    </script>
</body>
</html>